import { createStore } from "vuex";
import createPersistedState from "vuex-persistedstate";

const menu = {
  state: {
    list: [
      {
        title: "首页",
        path: "/index",
        children: []
      },
      {
        title: "系统管理",
        path: "/sys",
        children: [
          {
            title: "权限管理",
            path: "/permission",
            children: []
          }
        ]
      }
    ],
    activeKey: ""
  },
  actions: {},
  getters: {}
};

export default createStore({
  state: {},
  mutations: {},
  actions: {},
  modules: {
    menu: menu
  },
  plugins: [
    createPersistedState({
      storage: window.sessionStorage
    })
  ]
});
